import * as React from 'react'
import {compose} from 'recompose'
import {CurrentUser} from '../graphql'
import {curry} from 'ramda'

export default curry((ComposedComponent: React.Component) => {
    class CurrentUserComponent extends React.Component {
        render() {
            return (
                <div>
                    <CurrentUser render={props => (
                        <ComposedComponent {...this.props} {...props}/>
                    )}
                    />
                </div>
            )
        }
    }

    return CurrentUserComponent
})